<#function Convert(s)>
    <#assign str=""/>
    <#assign fag=0/>
    <#list s?split("_") as item>
        <#if fag gt 0>
            <#assign  str=str+(item?cap_first)/>
        <#else>
            <#assign  str=str+item/>
        </#if>
        <#assign  fag=fag+1/>
    </#list>
    <#return str>
</#function>
package ${package};
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.io.Serializable;
import javax.persistence.*;
<#assign Date=0/>
<#list entitys as entity>
    <#if entity.isPrimaryKeys=="YES">
        <#assign  Date=Date+1/>
    </#if>
</#list>
<#if Date gt 0>
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
</#if>
<#if swagger=="true">
import io.swagger.annotations.ApiModelProperty;
</#if>


@Data
@Entity
@Table(name = "${tableName}")
@EntityListeners(AuditingEntityListener.class)
public class ${Convert(tableName)?cap_first} implements Serializable {
<#list entitys as entity>

    /**
    * ${entity.note}
    */
    <#if entity.isPrimaryKeys=="YES">
    @Id
    </#if>
    <#if entity.type=="Date">
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    </#if>
    @Column(name = "${entity.name}")
    <#if swagger=="true">
    @ApiModelProperty(value="${entity.note}")
    </#if>
    private ${entity.type} ${Convert(entity.name)};

</#list>

    private static final long serialVersionUID = 1L;
}
